/**
 * Java Basic Syntax Examples
 * This class demonstrates the basic syntax elements of Java programming language
 */
public class JavaBasicSyntax {
    
    // Constants - using final keyword
    private static final String LANGUAGE_NAME = "Java";
    
    // Instance variables
    private int instanceVar;
    private String text;
    
    // Static variable
    private static int count = 0;
    
    /*
     * Main method - entry point of the application
     * @param args command line arguments
     */
    public static void main(String[] args) {
        // Creating an instance of the class
        JavaBasicSyntax example = new JavaBasicSyntax();
        
        // Demonstrating different data types
        example.demonstrateDataTypes();
        
        // Demonstrating variables and constants
        example.showVariablesAndConstants();
        
        // Demonstrating operators
        example.performOperations();
    }
    
    /**
     * Method to demonstrate Java data types
     */
    public void demonstrateDataTypes() {
        // Primitive data types
        byte byteValue = 127;                    // 8-bit signed integer
        short shortValue = 32767;                // 16-bit signed integer
        int intValue = 2147483647;               // 32-bit signed integer
        long longValue = 9223372036854775807L;   // 64-bit signed integer
        float floatValue = 3.14f;                // 32-bit floating point
        double doubleValue = 3.14159;            // 64-bit floating point
        char charValue = 'A';                    // 16-bit Unicode character
        boolean booleanValue = true;             // true or false
        
        System.out.println("=== Data Types Examples ===");
        System.out.println("byte: " + byteValue);
        System.out.println("short: " + shortValue);
        System.out.println("int: " + intValue);
        System.out.println("long: " + longValue);
        System.out.println("float: " + floatValue);
        System.out.println("double: " + doubleValue);
        System.out.println("char: " + charValue);
        System.out.println("boolean: " + booleanValue);
    }
    
    /**
     * Method to show variables and constants usage
     */
    public void showVariablesAndConstants() {
        // Local variables
        int localCounter = 10;
        String message = "Hello Java!";
        
        System.out.println("\n=== Variables and Constants Examples ===");
        System.out.println("Language name (constant): " + LANGUAGE_NAME);
        System.out.println("Local counter (variable): " + localCounter);
        System.out.println("Message (variable): " + message);
        
        // Modifying variable values
        localCounter = 20;
        message = "Modified message";
        
        System.out.println("Modified counter: " + localCounter);
        System.out.println("Modified message: " + message);
    }
    
    /**
     * Method to perform operations with different operators
     */
    public void performOperations() {
        int a = 10;
        int b = 5;
        
        System.out.println("\n=== Operators Examples ===");
        // Arithmetic operators
        System.out.println("Arithmetic Operations:");
        System.out.println(a + " + " + b + " = " + (a + b));
        System.out.println(a + " - " + b + " = " + (a - b));
        System.out.println(a + " * " + b + " = " + (a * b));
        System.out.println(a + " / " + b + " = " + (a / b));
        System.out.println(a + " % " + b + " = " + (a % b));
        
        // Comparison operators
        System.out.println("\nComparison Operations:");
        System.out.println(a + " > " + b + " : " + (a > b));
        System.out.println(a + " < " + b + " : " + (a < b));
        System.out.println(a + " == " + b + " : " + (a == b));
        System.out.println(a + " != " + b + " : " + (a != b));
        
        // Logical operators
        boolean x = true;
        boolean y = false;
        
        System.out.println("\nLogical Operations:");
        System.out.println(x + " && " + y + " : " + (x && y));
        System.out.println(x + " || " + y + " : " + (x || y));
        System.out.println("!" + x + " : " + (!x));
    }
}